package cn.iocoder.yudao.module.api.pay.refund.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

/**
 * 退款单创建 DTO
 *
 * @author 芋道源码
 * @author 山野羡民
 */
@Data
public class PayRefundCreateDTO {

    @Schema(description = "商户交易单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "RCG202406271105343545")
    @NotBlank(message = "商户交易单号不能为空")
    private String tradeNo;

    @Schema(description = "统一支付单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "URF202406271105343545")
    @NotBlank(message = "统一支付单号不能为空")
    private String payNo;

    @Schema(description = "退款金额，单位：分")
    @NotNull(message = "退款金额不能为空")
    @DecimalMin(value = "0", message = "退款金额必须大于等于零")
    private Integer refundPrice;

    @Schema(description = "退款原因", example = "不香")
    @NotBlank(message = "退款原因不能为空")
    private String reason;

    @Schema(description = "退款结果的 notify 回调地址")
    @URL(message = "退款结果的回调地址必须是 URL 格式")
    private String notifyUrl;

    @Schema(description = "用户 IP", example = "127.0.0.1")
    private String userIp;

    @Schema(description = "用户 UA")
    private String userUa;

}
